﻿<Window x:Class="ReplicationExplorer.ConnectDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Connect to Distributor server" Height="300" Width="330" 
        WindowStartupLocation="CenterOwner"
        ResizeMode="NoResize" 
        ShowInTaskbar="False"
        FocusManager.FocusedElement="{Binding ElementName=cbServerName}"
        >
    <Grid Width="Auto" Height="Auto">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="40" />
            <RowDefinition Height="40" />
            <RowDefinition Height="60" />
            <RowDefinition Height="60"/>
        </Grid.RowDefinitions>
        
        <Grid.Background>
            <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                <GradientStop Color="White" Offset="0.0" />
                <GradientStop Color="LightGray" Offset="1.0" />
            </LinearGradientBrush>
        </Grid.Background>



        <DockPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" >
            <TextBlock DockPanel.Dock="Left" Text="Connect to Distributor server" Margin="5" FontWeight="Bold" VerticalAlignment="Center" />
            <Image DockPanel.Dock="Right"  Source="Images/DistributorServer.png" Margin="5" />
        </DockPanel>
        
        <TextBlock Grid.Row="1" Grid.Column="0" Text="Server name:" Margin="5" VerticalAlignment="Top" />
        <ComboBox IsEditable="True" Grid.Column="1" Grid.Row="1" MinWidth="160" Height="25" Margin="5" VerticalAlignment="Top" Name="cbServerName" TabIndex="0">
            
        </ComboBox>
        <TextBlock Grid.Row="2" Grid.Column="0" Text="Authentication:" Margin="5" VerticalAlignment="Top" />
        <ComboBox Name="authenticationType" Grid.Column="1" Grid.Row="2" IsEditable="False" Height="25" Margin="5" VerticalAlignment="Top" SelectionChanged="authenticationType_SelectionChanged" TabIndex="1">
            <ComboBoxItem Content="Windows Authentication"  IsSelected="True" />
            <ComboBoxItem Content="Sql Authentication" />
        </ComboBox>

        <Grid Name="sqlAuthenticationCredentials" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Width="Auto" Height="Auto" Visibility="Hidden">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Text="User name:" Margin="5" />
            <TextBox Grid.Row="0" Grid.Column="1" Margin="5" Name="tbUserName" Tag="2" />
            <PasswordBox Grid.Row="1" Grid.Column="1" Margin="5" Name="tbPassword" Tag="3" /> 
            <TextBlock Grid.Row="1" Grid.Column="0" Text="Password:" Margin="5" />

        </Grid>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10">
            <Button  Width="100" Height="25" Content="Connect" Margin="3" Name="btnConnect" Click="btnConnect_Click" TabIndex="4" />
            <Button  Width="100" Height="25" Content="Cancel" Margin="3" Name="btnCancel" Click="btnCancel_Click" TabIndex="5" />
        </StackPanel>
        
        
    </Grid>
</Window>
